<?php
class DisplaySingle extends MY_Controller{
    function __construct(){
    	parent::__construct();
    }
    function index(){
    }
    function person(){
   		 // Get personID from URI
   	    $personID = $this->uri->segment(3);
    	$this->load->model('displayHandler');
    	// Set title
    	$data['title'] = "Person";
    	// Get person and shows from database 
    	$data['person'] = $this->displayHandler->getPersonByID($personID);
   		$data['cast'] = $this->displayHandler->getActingJobs($personID);
   		$data['crew'] = $this->displayHandler->getCrewJobs($personID);
   		// Load view with data as parameter
   		$this->load->view('singlePersonView', $data);
   		$this->load->view('includes/footer');
    }
    function show(){
    	// Get showID from URI
       	$showID = $this->uri->segment(3);
    	$this->load->model('displayHandler');
    	// Set title
    	$data['title'] = "Show";
    	// Get show, cast and crew from database
    	$data['show'] = $this->displayHandler->getShowByID($showID);
   		$data['crew'] = $this->displayHandler->getCrewByShowID($showID);
		$data['cast'] = $this->displayHandler->getCastByShowID($showID);
		// Load view with data as parameter
		$this->load->view('singleShowView', $data);
		$this->load->view('includes/footer');
    }
}